package com.kele.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kele.entity.User;
import com.kele.mapper.UserMapper;
import com.kele.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author kele
 * @since 2022-01-07
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public List<User> getAll() {
        return this.baseMapper.selectList(null);
    }

    @Override
    public IPage<User> selectPage(Page page) {
        Page qwPage = new Page(page.getCurrent(),page.getSize());
        return this.baseMapper.selectPage(qwPage, null);
    }
}
